<?php
    /**
    * Actions Map save
    * @author: trungdt
    * @since: feb 1, 2011
    * @version: 1.0
    * 
    * Change logs
    * feb 1, 2011 - trungdt - first create
    * 
    */

    if (!defined('EXPONENT')) exit('');
    if (exponent_users_isLoggedIn() && exponent_users_isAdmin())
    {
        $action = null;
        if (!empty($_POST['id'])) {
            $action = $db->selectObject('action_maps', 'id='.intval($_POST['id']));
        }

        $action = actions_map::update($_POST, $action);

        if (isset($action->id)) {
            $db->updateObject($action,'action_maps');
        } else {
            $db->insertObject($action,'action_maps');
        }

        exponent_flow_redirect();
    }
?>